feat/CUS-10801-Migrated the addon to EU Region#341
Conversation
📝 WalkthroughWalkthroughThis PR introduces a new Maven-based addon module that enables date format conversion functionality across six Testsigma platforms (Android, iOS, Mobile Web, REST API, Web, Windows), with each platform receiving a dedicated action implementation that parses input dates and reformats them to specified output formats. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (5)
convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java (2)
9-10: Remove unused imports.
NoSuchElementExceptionis only in thethrowsclause but never actually thrown by this code. More importantly,org.openqa.selenium.devtools.v135.io.IOis completely unused and pins to a specific Chrome DevTools protocol version — remove it.Proposed fix
-import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.devtools.v135.io.IO;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java` around lines 9 - 10, Remove the unused imports in DateFormatConversion: delete the org.openqa.selenium.devtools.v135.io.IO import and the unused org.openqa.selenium.NoSuchElementException import; then update any method signatures (e.g., in DateFormatConversion) that declare throws NoSuchElementException to remove it since the code never throws it. Ensure no other code references IO or NoSuchElementException before committing.
37-69: All six platform files contain identicalexecute()logic — extract a shared helper.The
execute()body (format parsing, date conversion, runtime data storage, error handling) is copy-pasted verbatim across Android, iOS, MobileWeb, REST API, Web, and Windows classes. Any bug fix or enhancement must be replicated six times, which is error-prone.Extract the conversion logic into a shared utility method (e.g.,
DateFormatHelper.convert(...)) and have each platform class delegate to it. Each platform-specific class then only provides the framework-required boilerplate (class declaration + annotation).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java` around lines 37 - 69, The execute() method in DateFormatConversion duplicates date parsing/formatting and runtime variable storage across platforms; extract that logic into a shared utility (e.g., create DateFormatHelper.convert(String inputDate, String inputFormat, String outputFormat, String runtimeVarKey, RunTimeData runTimeData) that returns the formatted string or throws a checked exception) and update DateFormatConversion.execute() to simply call that helper (pass testData1.getValue(), testData2.getValue(), testData3.getValue(), runtimeVar.getValue(), and runTimeData) and handle success/failure logging and messages there; keep the platform classes’ signatures and only delegate to DateFormatHelper to remove the duplicated parsing/formatting and error-handling code.convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java (1)
3-3: Remove unusedAndroidActionimport.This class extends
WebAction, notAndroidAction. Leftover from copy-paste.Proposed fix
-import com.testsigma.sdk.AndroidAction;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java` at line 3, Remove the unused import of AndroidAction at the top of DateFormatConversion.java: delete the line importing com.testsigma.sdk.AndroidAction since this class extends WebAction (class DateFormatConversion) and the AndroidAction symbol is not referenced anywhere in the file to avoid unused import warnings.convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java (1)
6-6: Remove unusedWebActionimport.This class extends
AndroidAction. Leftover from copy-paste.Proposed fix
-import com.testsigma.sdk.WebAction;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java` at line 6, Remove the unused import com.testsigma.sdk.WebAction from the DateFormatConversion class to clean up the leftover copy-paste; locate the import statement at the top of the file where DateFormatConversion is declared (class DateFormatConversion extends AndroidAction) and delete the WebAction import line so only required imports remain.convert_date_format/pom.xml (1)
42-46: TestNG dependency is missing<scope>test</scope>.Without a
testscope, TestNG (and its transitive dependencies) will be bundled into the shaded production jar, unnecessarily inflating its size. Also, version6.14.3is quite dated.Proposed fix
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.14.3</version> + <scope>test</scope> </dependency>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@convert_date_format/pom.xml` around lines 42 - 46, The TestNG dependency block currently lacks a test scope and uses an old version; update the org.testng:testng dependency in pom.xml by adding <scope>test</scope> to prevent TestNG from being bundled into the shaded production jar and bump the version to a newer stable release (e.g., 7.x) so tests run on a supported TestNG; ensure the change is applied to the dependency element for org.testng:testng.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java`:
- Around line 16-18: The Action annotation's description is incorrect for the
DateFormatConversion action; update the description parameter in the `@Action`
annotation for the DateFormatConversion class (and the equivalent class in the
other 5 platform files) to a user-facing, accurate string such as "Convert a
date from format1 to format2 and store it in a runtime variable" so the
Testsigma UI shows the correct purpose of the action; ensure you modify the
description value in the `@Action` annotation for DateFormatConversion across all
six platform-specific files.
In `@convert_date_format/src/main/resources/testsigma-sdk.properties`:
- Line 1: The committed JWT in testsigma-sdk.properties (property
testsigma-sdk.api.key) must be removed and replaced with a runtime-config
pattern that reads the secret from an environment variable or secrets manager;
delete the hard-coded value from testsigma-sdk.properties, add a placeholder or
comment pointing to an env var (e.g. TESTSIGMA_SDK_API_KEY), and update any code
that reads testsigma-sdk.api.key to fetch process/environment configuration (or
your config loader) instead of the file literal—also ensure the real key is
rotated and injected via CI/secret store, not committed to source control.
---
Nitpick comments:
In `@convert_date_format/pom.xml`:
- Around line 42-46: The TestNG dependency block currently lacks a test scope
and uses an old version; update the org.testng:testng dependency in pom.xml by
adding <scope>test</scope> to prevent TestNG from being bundled into the shaded
production jar and bump the version to a newer stable release (e.g., 7.x) so
tests run on a supported TestNG; ensure the change is applied to the dependency
element for org.testng:testng.
In
`@convert_date_format/src/main/java/com/testsigma/addons/android/DateFormatConversion.java`:
- Line 6: Remove the unused import com.testsigma.sdk.WebAction from the
DateFormatConversion class to clean up the leftover copy-paste; locate the
import statement at the top of the file where DateFormatConversion is declared
(class DateFormatConversion extends AndroidAction) and delete the WebAction
import line so only required imports remain.
In
`@convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java`:
- Around line 9-10: Remove the unused imports in DateFormatConversion: delete
the org.openqa.selenium.devtools.v135.io.IO import and the unused
org.openqa.selenium.NoSuchElementException import; then update any method
signatures (e.g., in DateFormatConversion) that declare throws
NoSuchElementException to remove it since the code never throws it. Ensure no
other code references IO or NoSuchElementException before committing.
- Around line 37-69: The execute() method in DateFormatConversion duplicates
date parsing/formatting and runtime variable storage across platforms; extract
that logic into a shared utility (e.g., create DateFormatHelper.convert(String
inputDate, String inputFormat, String outputFormat, String runtimeVarKey,
RunTimeData runTimeData) that returns the formatted string or throws a checked
exception) and update DateFormatConversion.execute() to simply call that helper
(pass testData1.getValue(), testData2.getValue(), testData3.getValue(),
runtimeVar.getValue(), and runTimeData) and handle success/failure logging and
messages there; keep the platform classes’ signatures and only delegate to
DateFormatHelper to remove the duplicated parsing/formatting and error-handling
code.
In
`@convert_date_format/src/main/java/com/testsigma/addons/mobileweb/DateFormatConversion.java`:
- Line 3: Remove the unused import of AndroidAction at the top of
DateFormatConversion.java: delete the line importing
com.testsigma.sdk.AndroidAction since this class extends WebAction (class
DateFormatConversion) and the AndroidAction symbol is not referenced anywhere in
the file to avoid unused import warnings.
| @Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", | ||
| description = "To store the number of char from testdata into runtime variable", | ||
| applicationType = ApplicationType.IOS) |
There was a problem hiding this comment.
Inaccurate description — applies to all 6 platform files.
The description says "To store the number of char from testdata into runtime variable" which describes a character-count action, not a date format conversion. This text is user-facing in the Testsigma UI and will mislead users.
Proposed fix
- description = "To store the number of char from testdata into runtime variable",
+ description = "Convert a date string from one format to another and store the result in a runtime variable",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Action(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", | |
| description = "To store the number of char from testdata into runtime variable", | |
| applicationType = ApplicationType.IOS) | |
| `@Action`(actionText = "Convert the date from the testdata in format1 to format2 and store it in a runtime variable", | |
| description = "Convert a date string from one format to another and store the result in a runtime variable", | |
| applicationType = ApplicationType.IOS) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@convert_date_format/src/main/java/com/testsigma/addons/ios/DateFormatConversion.java`
around lines 16 - 18, The Action annotation's description is incorrect for the
DateFormatConversion action; update the description parameter in the `@Action`
annotation for the DateFormatConversion class (and the equivalent class in the
other 5 platform files) to a user-facing, accurate string such as "Convert a
date from format1 to format2 and store it in a runtime variable" so the
Testsigma UI shows the correct purpose of the action; ensure you modify the
description value in the `@Action` annotation for DateFormatConversion across all
six platform-specific files.
| @@ -0,0 +1 @@ | |||
| testsigma-sdk.api.key=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNTgxZDNlYy02Zjk2LTg3NDktZThmNS1hYjEwMWIwZDA1NTQiLCJ1bmlxdWVJZCI6IjM0NzUiLCJpZGVudGl0eUFjY291bnRVVUlkIjoiODZlMGQ1ODUtZTVlYi05NmIxLTAyZDktOTRkODM3N2RiMzlmIn0._yGbSllZqQTBvmNoMYpRuCsd4Z_9565FWjGtrNAmZzQP1i8WSpndSNDbUrzo8Iv6FxIAyvH_c5inCIIHuWX0ow No newline at end of file | |||
There was a problem hiding this comment.
🔴 API key / JWT token committed to source control — secrets leak.
This JWT is a real credential (contains sub, uniqueId, identityAccountUUId claims) and will be publicly visible in the repository history even if later removed. Secrets must never be checked into version control.
Rotate this key immediately and load it from an environment variable, CI secret, or a secrets manager at build/runtime instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@convert_date_format/src/main/resources/testsigma-sdk.properties` at line 1,
The committed JWT in testsigma-sdk.properties (property testsigma-sdk.api.key)
must be removed and replaced with a runtime-config pattern that reads the secret
from an environment variable or secrets manager; delete the hard-coded value
from testsigma-sdk.properties, add a placeholder or comment pointing to an env
var (e.g. TESTSIGMA_SDK_API_KEY), and update any code that reads
testsigma-sdk.api.key to fetch process/environment configuration (or your config
loader) instead of the file literal—also ensure the real key is rotated and
injected via CI/secret store, not committed to source control.
Publish this addon as public (EU Region)
Addon Name: Convert Date Format
Jarvis Link: https://jarvis-eu.testsigma.com/ui/tenants/66076/addons
Jira : https://testsigma.atlassian.net/browse/CUS-10801
Migrated the addon to EU Region
Summary by CodeRabbit
Release Notes